<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - AI故事生成器</title>
    <link rel="stylesheet" href='/static/css/login.css'>
</head>
<body>

    <main class="container">
        <div class="auth-form">
            <h1>登录账号</h1>

            <form method="post" action="{% url 'store_system:login' %}">
                <div class="form-group">
                    <label for="text">用户名或邮箱</label>
                    <input type="text" id="text" name="username" required>
                </div>

                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" id="password" name="password" required>
                </div>

                <div class="form-options">
                    <label>
                        <input type="checkbox"> 记住我
                    </label>
                    <a href="#">忘记密码?</a>
                </div>
                {% if error %}
                    <div class="error-box">
                        <div class="error-content">
                            <div class="error-message">{{ error }}</div>
                        </div>
                    </div>
                {% endif %} 
                <button type="submit" class="btn btn-primary">登录</button>
            {% csrf_token %}
            </form>

            <p class="auth-switch">
                还没有账号? <a href="{% url 'store_system:register' %}">立即注册</a>
            </p>
        </div>
    </main>

</body>
</html>